<template>
  <el-form
    ref="form"
    :inline="true"
    :model="form"
    :rules="rules"
    size="small"
    label-width="80px"
  >
    <el-card class="box-card" shadow="never">
      <div class="head-container">
        <div class="table_title">基本信息</div>
      </div>
      <el-form-item label="姓名">
        <el-input
          v-model="currentPatient.patientName"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="门诊号">
        <el-input
          v-model="currentPatient.outpatientNum"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="性别">
        <el-input
          :value="getLabel(currentPatient.gender, GENDET_LIST)"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="年龄">
        <el-input
          v-model="currentPatient.age"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="住址">
        <el-input
          v-model="currentPatient.addr"
          placeholder="请输入"
          clearable
        />
      </el-form-item>
      <el-form-item label="电话">
        <el-input
          v-model="currentPatient.phoneNum"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="门诊">
        <el-radio-group v-model="currentPatient.roleName">
          <el-radio :label="1">是</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="床号">
        <el-input
          v-model="currentPatient.patientName"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="主要诊断">
        <el-input
          v-model="currentPatient.patientName"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <el-form-item label="医嘱信息">
        <el-input
          v-model="currentPatient.patientName"
          placeholder="请输入"
          clearable
          disabled
        />
      </el-form-item>
      <!-- </el-card>
    <el-card class="box-card" shadow="never"> -->
      <div class="head-container">
        <div class="table_title">操舱医嘱</div>
      </div>
      <el-form-item label="1、表压" prop="roleName">
        <el-input
          v-model="adviceHyperbaricOxygen.gaugePressure"
          placeholder="请输入"
          clearable
        >
          <template slot="append">Mpa</template>
        </el-input>
      </el-form-item>
      <el-form-item label="2、方案">
        <el-form-item label="单次吸氧" prop="roleName" label-width="100px">
          <el-input
            v-model="adviceHyperbaricOxygen.singleOxygenMinute"
            placeholder="请输入"
            clearable
            class="num_input"
          >
            <template slot="append">分钟</template>
          </el-input>
        </el-form-item>
        <el-form-item label="" prop="roleName">
          <el-input
            v-model="adviceHyperbaricOxygen.singleOxygenNum"
            placeholder="请输入"
            clearable
            class="num_input"
          >
            <template slot="append">次</template>
          </el-input>
        </el-form-item>
      </el-form-item>
      <el-form-item label=" ">
        <el-form-item label="间隔吸空气" prop="roleName" label-width="100px">
          <el-input
            v-model="adviceHyperbaricOxygen.intervalOxygenMinute"
            placeholder="请输入"
            clearable
            class="num_input"
          >
            <template slot="append">分钟</template>
          </el-input>
        </el-form-item>
        <el-form-item label="" prop="roleName">
          <el-input
            v-model="adviceHyperbaricOxygen.intervalOxygenNum"
            placeholder="请输入"
            clearable
            class="num_input"
          >
            <template slot="append">次</template>
          </el-input>
        </el-form-item>
      </el-form-item>
      <el-form-item label="3、疗程">
        <el-form-item prop="roleName" label-width="100px">
          <el-input
            v-model="adviceHyperbaricOxygen.exePeriod"
            placeholder="请输入"
            clearable
            class="num_input"
          >
            <template slot="append">次/日</template>
          </el-input>
        </el-form-item>
        <el-form-item label="" prop="roleName">
          <el-input
            v-model="currentPatient.periodNum"
            placeholder="请输入"
            clearable
            class="num_input"
          >
            <template slot="append">日</template>
          </el-input>
        </el-form-item>
      </el-form-item>
      <el-form-item label="医生签名" prop="doctorSign">
        <div class="item_content">{{ adviceHyperbaricOxygen.doctorSign }}</div>
      </el-form-item>
      <el-form-item label="申请时间" prop="createTime">
        <div class="item_content">{{ adviceHyperbaricOxygen.createTime }}</div>
      </el-form-item>
      <el-form-item label="疗效" prop="curativeEffect">
        <el-radio-group v-model="adviceHyperbaricOxygen.curativeEffect">
          <el-radio
            v-for="item in CURATIVE_EFFECT_LIST"
            :key="item.value"
            :label="item.value"
          >
            {{ item.label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item
        label="中断治疗原因"
        prop="treatmentInterruptionReason"
        label-width="120px"
      >
        <el-radio-group
          v-model="adviceHyperbaricOxygen.treatmentInterruptionReason"
        >
          <el-radio
            v-for="item in INTERRUPT_REASON_LIST"
            :key="item.value"
            :label="item.value"
          >
            {{ item.label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item
        label="液压氧治疗过程中病情简要"
        prop="note"
        class="text_area_item"
        label-width="200px"
      >
        <el-input
          v-model="adviceHyperbaricOxygen.briefCondition"
          :autosize="{ minRows: 1 }"
          type="textarea"
        />
      </el-form-item>
    </el-card>
  </el-form>
</template>
<script>
import {
  CURATIVE_EFFECT_LIST,
  INTERRUPT_REASON_LIST,
  GENDET_LIST,
  getLabel,
} from "../enums";
import Cookies from "js-cookie";
const defaultForm = {};
export default {
  name: "operationDoctorAdviceModule",
  data() {
    return {
      form: {},
      rules: {},
      CURATIVE_EFFECT_LIST,
      INTERRUPT_REASON_LIST,
      GENDET_LIST,
    };
  },
  computed: {
    currentPatient() {
      const info = Cookies.get("currentPatient");
      try {
        return info ? JSON.parse(info) : {};
      } catch (res) {
        return {};
      }
    },
    adviceHyperbaricOxygen() {
      return this.currentPatient.adviceHyperbaricOxygen || {};
    },
  },
  created() {},
  methods: {
    getLabel,
  },
};
</script>
<style lang="scss" scoped>
/deep/.crud-opts {
  display: inline-flex;
}

.table_title {
  display: inline-block;
  line-height: 30px;
  margin: 0 10px 0 0;
  vertical-align: middle;
  font-weight: bold;
  color: #303133;
  font-size: 15px;
}

.item_content {
  min-width: 100px;
}

.head-container {
  line-height: 30.5px;
  padding-bottom: 0;

  /deep/.filter-item {
    margin-bottom: 0;
  }
}

.num_input {
  width: 160px;
}

.text_area_item {
  width: 100%;

  /deep/.el-form-item__content {
    width: calc(100% - 200px);
  }
}
</style>
